<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>UI组件</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>
    <div id="mapContainer" style="position: relative;"></div>
</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    window.app = new GE.App('mapContainer', {
        position: [120.152925, 30.248748, 1500], //相机的位置  
        lookAt: [120.152925, 30.248748, 0], //相机看向的地图位置
        cameraScrollSpeed: 5, //鼠标滚动时，控制相机移动的速度
        minZoom: 3, //允许地图的最小层级
        maxZoom: 21, //允许地图的最大层级
        ambientLightIntensity: 5,
        useDefaultTexture: true, //是否使用瓦片默认纹理
        maxSlopeAngle: 80, //地图最大倾斜角度
        baseLayer: [
            //影像底图
            {
                url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', //影像底图的url
                // url: 'http://115.236.87.26:8848/googleTiles/china_image/{z}/{y}/{x}.jpg',
                urlDecimal: true, //影像底图url中的瓦片行列号是否是十进制，true表示十进制，false表示十六进制
                tileType: 'image', //影像底图
                canNotSelect: false, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            }
        ]
    });
 
    // 指北针
    const compass = new GE.Compass('http://localhost:9009/examples/resources/image/earth-navi-control-pc4.png');
    window.app.ui.add(compass);

    // 按钮
    const plusBtn = new GE.ZoomButton(true); //地图放大
    const minusBtn = new GE.ZoomButton(false); //地图缩小
    window.app.ui.add(plusBtn);
    window.app.ui.add(minusBtn);

    // 比例尺
    let scale = new GE.Scale();
    window.app.ui.add(scale);

    //按钮
    let button = new GE.Button('按钮', function () {
            alert('按钮被点击了');
    });
    window.app.ui.add(button);
</script>

</html>